<?  layout("../layout/default.html") { ?>
<div class="admin-panel">
	<div class="tab">
		<div class="tab-head">
			<strong><? if(@data.isNew()){ ?>添加<? }else{ ?>编辑<?} ?></strong>
			<span class="tab-more"><a href="javascript:history.go(-1)" class="button  button-little bg-blue  icon-step-backward"> 返回</a></span>
			<ul class="tab-nav">
			  <li class="active"><a href="#tab-set">信息</a></li>
			</ul>
		</div>
		<div class="tab-body">
		<script type="text/javascript">
			function check(){
				var reg=/[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}:[A-F\d]{2}/; 
				var str0 = document.getElementById("phymapping_loc_id").value;
				var str3 = document.getElementById("phymapping_mac_addr").value;
				if(str0.length>20){
					alert("对不起，设备id过长");
					document.getElementById("phymapping_loc_id").value;
					return false;
				}
				if(!str3.match(reg)){
					alert("请输入正确格式的Mac地址");
					document.getElementById("phymapping_mac_addr").value="";
					return false;
				}

			}
		</script>
			<div class="tab-panel active" id="tab-set">
				<form method="post" class="form-x" action="">
					<div class="form-group">
						<div class="label"><label for="sitename">所属设备id</label></div>
						<div class="field">
						<input type="text" class="input" id="phymapping_loc_id" name="phymapping.loc_id" size="200" placeholder="请填写所属设备id" data-validate="required:请填写所属设备id,number:请填写数字" value="${data.loc_id!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">物理地址</label></div>
						<div class="field">
						<input type="text" class="input" id="phymapping_phy_addr" name="phymapping.phy_addr" size="200" placeholder="请填写物理地址" data-validate="required:请填写物理地址" value="${data.phy_addr!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">mac地址</label></div>
						<div class="field">
						<input type="text" class="input" id="phymapping_mac_addr" name="phymapping.mac_addr" size="200" placeholder="请填写mac地址" data-validate="required:请填写mac地址" value="${data.mac_addr!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">类型</label></div>
						<div class="field">
						<input type="text" class="input" id="phymapping_type" name="phymapping.type" size="200" placeholder="请填写类型" data-validate="required:请填写类型" value="${data.type!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">线路</label></div>
						<div class="field">
						<input type="text" class="input" id="phymapping_route" name="phymapping.route" size="200" placeholder="请填写线路" data-validate="required:请填写大楼,number:请填写数字" value="${data.route!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">实线虚线</label></div>
						<div class="field">
						<input type="text" class="input" id="phymapping_tag" name="phymapping.tag" size="200" placeholder="请填实线/虚线" data-validate="required:请填写[实线/虚线]" value="${data.tag!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">描述</label></div>
						<div class="field">
						<input type="text" class="input" id="phymapping_describe" name="phymapping.describe" size="200" placeholder="请填写描述" data-validate="required:请填写描述" value="${data.describe!""}"/>
						</div>
					</div>
					<div class="form-group">
						<div class="label"><label for="sitename">状态</label></div>
						<div class="field">
						<input type="text" class="input" id="phymapping_status" name="phymapping.status" size="200" placeholder="请填写状态(工作/保修/待机)" data-validate="required:请填写状态" value="${data.status!""}"/>
						</div>
					</div>
				<div class="form-button"><button class="button bg-main" type="submit" onclick="return check()">提交</button></div>
			    </form>
			</div>
		</div>
	</div>
</div>
<?  } ?>			